V2 APIs - Mint under custom contract
Single mint - Non-Async
Non-async endpoint will wait till the mint process completetion and then only respond.
Base URL:
https://api.0xmint.io
End point:
/v2/collection/mint
Request type : application/json
Request method : POST
| Parameters | Type | Description |
|---|---|---|
| Header x-api-key | string | API key from dashboard |
| Header x-auth-token | string | JWT token |
| wallet | string | The owner of the contract |
| contractAddress | string | The contract address created from the API page |
| to | string | The address to which the NFT to be airdropped |
| tokenUri | string | The token URI of the NFT |
| supply | integer | No.of supply for ERC1155 (only if the contract is ERC115) |
Example request body:
{
"wallet": "0x2631e5e8717fAeaD0EBa72fEd5694aD1Fa0d3581",
"contractAddress": "0x8fbdE7Be7c7fbb8C99fE51131298a13D289d286d",
"to": "0x2631e5e8717fAeaD0EBa72fEd5694aD1Fa0d3581",
"tokenUri": "ipfs://hash"
}
Response:
200 - Mint successfull
{
"status": true,
"message": "Mint success",
"data": {
"transactionHash": "0xbd8bc112e93eeff263ab5cda24dec4c31cef3b67bec7bce89ef76fa95636789c",
"blockHash": "0x3e45a1ea07ad0bbccc2ba3ad9e619ed858d325cbdf595f860f45cf81bb0d3934",
"blockNumber": 33870961,
"contractAddress": null,
"effectiveGasPrice": 34650000023,
"cumulativeGasUsed": 6468986,
"from": "0xf0938ee70aeab854b09cca31eac9f056b73a87ee",
"gasUsed": 117778,
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000008000000000000000000000000000000000000000000000000008000000800000000000040000000100000000000008000000020000000000000010000800000000000080000090000010000020000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000020000000000002000000000004000800002000000000001000000008000000000008000000000100000000020200000020000000000000000008000000000000000000000000000000000100000",
"status": true,
"to": "0x86c80a8aa58e0a4fa09a69624c31ab2a6cad56b8",
"transactionIndex": 40,
"type": "0x2",
"events": {
"0": {
"transactionHash": "0xbd8bc112e93eeff263ab5cda24dec4c31cef3b67bec7bce89ef76fa95636789c",
"address": "0x8fbdE7Be7c7fbb8C99fE51131298a13D289d286d",
"blockHash": "0x3e45a1ea07ad0bbccc2ba3ad9e619ed858d325cbdf595f860f45cf81bb0d3934",
"blockNumber": 33870961,
"logIndex": 163,
"removed": false,
"transactionIndex": 40,
"id": "log_3992a891",
"returnValues": {},
"signature": null,
"raw": {
"data": "0x",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000002631e5e8717faead0eba72fed5694ad1fa0d3581",
"0x0000000000000000000000000000000000000000000000000000000000000004"
]
}
},
"1": {
"transactionHash": "0xbd8bc112e93eeff263ab5cda24dec4c31cef3b67bec7bce89ef76fa95636789c",
"address": "0x0000000000000000000000000000000000001010",
"blockHash": "0x3e45a1ea07ad0bbccc2ba3ad9e619ed858d325cbdf595f860f45cf81bb0d3934",
"blockNumber": 33870961,
"logIndex": 164,
"removed": false,
"transactionIndex": 40,
"id": "log_b5588d35",
"returnValues": {},
"signature": null,
"raw": {
"data": "0x000000000000000000000000000000000000000000000000000e7fa7a648bd000000000000000000000000000000000000000000000000012fccd0d38b36ae0d000000000000000000000000000000000000000000000250e38b69a0d6914f200000000000000000000000000000000000000000000000012fbe512be4edf10d000000000000000000000000000000000000000000000250e399e9487cda0c20",
"topics": [
"0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x000000000000000000000000f0938ee70aeab854b09cca31eac9f056b73a87ee",
"0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49"
]
}
}
}
}
}
Single mint - Async
Async endpoint will respond immediately even if the mint is not completed. Useful in place where there is no need to wait the transaction to complete.
End point:
/v2/collection/async/mint
Request type : application/json
Request method : POST
| Parameters | Type | Description |
|---|---|---|
| Header x-api-key | string | API key from dashboard |
| Header x-auth-token | string | JWT token |
| wallet | string | The owner of the contract |
| contractAddress | string | The contract address created from the API page |
| to | string | The address to which the NFT to be airdropped |
| tokenUri | string | The token URI of the NFT |
Example request body:
{
"wallet": "0x2631e5e8717fAeaD0EBa72fEd5694aD1Fa0d3581",
"contractAddress": "0x8fbdE7Be7c7fbb8C99fE51131298a13D289d286d",
"to": "0x2631e5e8717fAeaD0EBa72fEd5694aD1Fa0d3581",
"tokenUri": "ipfs://hash"
}
Response:
Status: 200
{
"status": true,
"message": "Mint in progress!"
}
Refresh JWT
Get a new JWT token
End point:
/v2/refreshJWT
Request type : application/json
Request method : POST
| Parameters | Type | Description |
|---|---|---|
| Header x-api-key | string | API key from dashboard |
| Header x-refresh-token | string | Refresh token |
| wallet | string | The wallet address associated with the api |
Response:
Status: 200
{
"status": true,
"jwt": "your new JWT.."
}